/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 08 - 28
 * Time: 18:01
 */
//牛客 二叉树的镜像
public class Solution3 {
    //法一 官方推荐方法
    public TreeNode Mirror (TreeNode pRoot) {
        MirrorF(pRoot);
        return pRoot;
    }
    public void MirrorF (TreeNode pRoot) {
        if(pRoot == null) return;
        TreeNode temp = pRoot.left;
        pRoot.left = pRoot.right;
        pRoot.right = temp;
        MirrorF(pRoot.left);
        MirrorF(pRoot.right);
    }
}
